<?php

class Articles_IndexController extends Cms_CustomControllerAction
{
public $db;

    public function init()
    {
        /* Initialize action controller here */
         $this->db = Zend_Registry::get('db');
    }

    public function indexAction()
    {
        
        $articles = Model_Articles::GetArticles($this->db);
       // echo'<pre>';print_r($articles->fetchAll());echo'</pre>';
       $this->view->articles = $articles;
    }
    
    public function viewAction()
    {
     
        $id = $this->_getParam('articlesAlias');
        $articles = new Model_Articles($this->db);
        $articles->load($id, 'alias');
        $this->view->articles = $articles;
          // echo'<pre>';print_r( $articles);echo'</pre>';
        //$this->view->articles =  $articles->getNewsAlias($id);
        
    }
    
}
